UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'u5HsrZsSDVwdtdHRXMPvoJQyXOk07HQtuVpfql8CXd4='
WHERE
key_id = 'b01c99127b261a9df17b8fbca53ca3ecd024fe59eaf0e0801641cd7eb4cfbfcc'
AND (
token = 'u5HsrZsSDVwdtdHRXMPvoJQyXOk07HQtuVpfql8CXd4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)