UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HJHGv9ZTpEdIhKQr4JfHn+LoFj4sJ4zuipMeH3NAyLQ=' 
WHERE 
  key_id = '95c72b26fedb06ee85deed0800e398e34c28bde99d3a7538fefd75338ea1632a' 
  AND (
    token = 'HJHGv9ZTpEdIhKQr4JfHn+LoFj4sJ4zuipMeH3NAyLQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022