UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jbMdYB8ARDfL6cvEvfZMmknKcL03LM/dDQW38X5IGZs='
WHERE
key_id = 'd64d5a6ba9eab8e7142b4324c051ec1a69618efe4c8ba6557ddf3f06976f3fe3'
AND (
token = 'jbMdYB8ARDfL6cvEvfZMmknKcL03LM/dDQW38X5IGZs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)