UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yZaC74D4U6nlNT0BIAGcsenexU+Ke/+Dz42A4ZtSY1A='
WHERE
key_id = 'fa1438d04cb6bece2d019e417585acc03e25bfb39c87507fdb88ea6981e1ba6a'
AND (
token = 'yZaC74D4U6nlNT0BIAGcsenexU+Ke/+Dz42A4ZtSY1A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)