UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IKzszrGuU9vFudFp+H2xaBe+oLwfc/cou300+Kk/flA='
WHERE
key_id = 'cb40ab4958a0e4ecabba9d3dd911a467df2f16351cb1c3f3f9245b9fa2b7715b'
AND (
token = 'IKzszrGuU9vFudFp+H2xaBe+oLwfc/cou300+Kk/flA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)