UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dvyWV+YjsZ7ha0bWrmB2IrAklalWeCOMiEGNbTmWv6A=' 
WHERE 
  key_id = 'b77002f32c31ebb8fe7e514737636f7eb2e6149783a2d4e805f644e12d3cea61' 
  AND (
    token = 'dvyWV+YjsZ7ha0bWrmB2IrAklalWeCOMiEGNbTmWv6A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052