UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YAw+9Ji2CeLrskVoJI+mln8xZlaXHSun9wl3RD2Q0Yk='
WHERE
key_id = '0ad5fcb99de16885bce5dddcbd5a6228c70b8273f8881cab7c8862cfe2c3f8ad'
AND (
token = 'YAw+9Ji2CeLrskVoJI+mln8xZlaXHSun9wl3RD2Q0Yk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)