UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZyIkHOKihXXg5isWxJrMe9W2TtBx3Jmnos1XluPcl58='
WHERE
key_id = '1a1a1bf751461d3bb0b07868db808b57f9ad1fbaa8ed628f1400a239d48b898b'
AND (
token = 'ZyIkHOKihXXg5isWxJrMe9W2TtBx3Jmnos1XluPcl58='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)