UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rHTtMMx5QDp8QcX1cmAKKS9oIh+lBbHnnL1OqEsut8U='
WHERE
key_id = '656eb98cfafdff8a3291adff3a201c0fe56ae48ba1aa9cc74de94c7987332912'
AND (
token = 'rHTtMMx5QDp8QcX1cmAKKS9oIh+lBbHnnL1OqEsut8U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)