UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1PQRXxiYAWW3YJpQrfLs+rPnubds/Lk8xytXGq4oxI8=' 
WHERE 
  key_id = 'ea444d27bf3e69f9be2003cc0072f83800989dd82c78d3d80fc02022f1eb63c8' 
  AND (
    token = '1PQRXxiYAWW3YJpQrfLs+rPnubds/Lk8xytXGq4oxI8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043