UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ieb675dfw29xNrSE/DtToWrOVabvg6Gj7m5gUKSDSW8='
WHERE
key_id = '43a7dcdedd2212145c0757545e56f3773923258386cee229588f8f871ca9a92a'
AND (
token = 'ieb675dfw29xNrSE/DtToWrOVabvg6Gj7m5gUKSDSW8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)