UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CuUEhx93KN2yKzgs5PheTWchI4v4UPYI9koNIgQQtSo=' 
WHERE 
  key_id = '295e5a146da377e2161cf6cc678d396523840c1f8fdba3310eae7495781362fe' 
  AND (
    token = 'CuUEhx93KN2yKzgs5PheTWchI4v4UPYI9koNIgQQtSo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044