UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6T8OPaDTNbqRMID5C4auNwf3YN/t/2S61lgHdKPoXBI='
WHERE
key_id = '0d7691f632f4b99725f987a6aaecbbca12fa0d9d86e47ced83f3076f75a71767'
AND (
token = '6T8OPaDTNbqRMID5C4auNwf3YN/t/2S61lgHdKPoXBI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)