UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oJNoexknt2RS3ktYrKrO5oPzdgVC7OGQR8lFgiQgLzI='
WHERE
key_id = '506a9fcf177a4740fefffc7d7073a3c958e27d65e7319fb9022d531be5ad1c52'
AND (
token = 'oJNoexknt2RS3ktYrKrO5oPzdgVC7OGQR8lFgiQgLzI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)