UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'u/iA30R4+Rz0zTbW1obByLAQcHh8QWICZ0GbSQQ3cYw='
WHERE
key_id = '8774fb166060d3876b74594e002674b90c87cfcc8839ec610b610dbff7fbd9d0'
AND (
token = 'u/iA30R4+Rz0zTbW1obByLAQcHh8QWICZ0GbSQQ3cYw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)