UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'M/l7tmF4sC1ziD37d8Pe4Ee4ceB6iaSj8IYm1ptDFBE='
WHERE
key_id = '033abf16587a3bf17fab56d4210626abd0c658220bf384486e34697731bee98f'
AND (
token = 'M/l7tmF4sC1ziD37d8Pe4Ee4ceB6iaSj8IYm1ptDFBE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)