UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DISp20PCRMwBbLVq9AT+QVzY3h/TzqvGVKmO7NtD6h8='
WHERE
key_id = '90e2f247885717fff9aa2cace2d019aa8b9ad5534e1d2e5ffb5ccd868cdc31a0'
AND (
token = 'DISp20PCRMwBbLVq9AT+QVzY3h/TzqvGVKmO7NtD6h8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)