UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SI74Q3/prRGxO770J60AV2xuyJd2Bm0B+JfM6lV4Xjk=' 
WHERE 
  key_id = '91662c3d3d23cc0fef131ef75e7414457899dec1cd5045f44339b584c0abcf98' 
  AND (
    token = 'SI74Q3/prRGxO770J60AV2xuyJd2Bm0B+JfM6lV4Xjk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031