UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xMuUEFVSVhKMCs5GTw02iJ/8odh6hX8YUHnzlPEMVs0=' 
WHERE 
  key_id = '69f6c40c76806f0d85b6fa98ef657d1730f1a98264e97caa739fda749592afaf' 
  AND (
    token = 'xMuUEFVSVhKMCs5GTw02iJ/8odh6hX8YUHnzlPEMVs0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043