UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ixhnR6wUE5d6MBZ/BsP5T7gE/78yLoH4ncxgOsaWQgk='
WHERE
key_id = '822439f563b52c7b40a252a3b5359d6437eba3a7f99517badc96dd9d86741b1c'
AND (
token = 'ixhnR6wUE5d6MBZ/BsP5T7gE/78yLoH4ncxgOsaWQgk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)