UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'K1lnxJzmog6U5yFcKQ//7Y8bULqS8bGzEON543atpFE='
WHERE
key_id = 'f825e52e02bb896ed7ef49ad932184ff9f0399178e8ce96e9b8751549beedd60'
AND (
token = 'K1lnxJzmog6U5yFcKQ//7Y8bULqS8bGzEON543atpFE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)