UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HcVBeyiX35qNN3XBhDcVs7gpClIxzgEzEbYLzIvU7wo='
WHERE
key_id = 'ab13fb118d0e5d489a081a87aaf32eddc68b5b61bac838e1924059389e8d1334'
AND (
token = 'HcVBeyiX35qNN3XBhDcVs7gpClIxzgEzEbYLzIvU7wo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)