UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/55BJGEC0fHvCQWMYQRtyo4HCng1JZikW1jq9Eri7V0='
WHERE
key_id = '18040d253c530bde667766b8463cf59be8d1207b28b2ad5359fe53c60c45e091'
AND (
token = '/55BJGEC0fHvCQWMYQRtyo4HCng1JZikW1jq9Eri7V0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)