UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'b+gTBofliddIIVXmOpHTMId4Hhz9s+YZy9ad/NAv4Sw='
WHERE
key_id = '1f157bcd945edca66b2c3501344a22a4135e175a4012187437f96692e4362d16'
AND (
token = 'b+gTBofliddIIVXmOpHTMId4Hhz9s+YZy9ad/NAv4Sw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)