UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GgexA91BWNYruzhWNl861D61KsmRFrJncmHP9EJbdZs=' 
WHERE 
  key_id = '8203c4e1c041e83ab99b08de3fa814258a4cf7db6517c60f0f9afeebefb56fb7' 
  AND (
    token = 'GgexA91BWNYruzhWNl861D61KsmRFrJncmHP9EJbdZs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049