UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tLRfMmHj+8kmxfXe0xFVBskXHN3iXLXSTViPhJCt6f0=' 
WHERE 
  key_id = '5cbfd7e84bc54e4c3bc4b6ddb87581a439999523b8b9545a8119f0bf1c2332e3' 
  AND (
    token = 'tLRfMmHj+8kmxfXe0xFVBskXHN3iXLXSTViPhJCt6f0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034