UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WRyIFRyKuWtQO+rT9cfwftuf8/A877Y+QXhtRVu5aFk='
WHERE
key_id = '9e7c0f966118b2b5e7a73132d07584edeee15800ca021c98811525f109b68515'
AND (
token = 'WRyIFRyKuWtQO+rT9cfwftuf8/A877Y+QXhtRVu5aFk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)