UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZRk8NTLnXJMTQayQFXjK6QtBViTOojAshMw9eM3CmAo='
WHERE
key_id = '5c0e1872577f5e68bda8556de26cd9f24e336d5a5f7bf2418aa499bff9138476'
AND (
token = 'ZRk8NTLnXJMTQayQFXjK6QtBViTOojAshMw9eM3CmAo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)