UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '252+sFRo791/BwOIVVGvbtilZzNZ1lTu36y3kHSuaqY=' 
WHERE 
  key_id = '273065f1dfecc77026f84d9de3b38f455266d1fda8a43ff278d9a8619eed9416' 
  AND (
    token = '252+sFRo791/BwOIVVGvbtilZzNZ1lTu36y3kHSuaqY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039