UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0kUC0QKpXw1LeojdNgDqjo3qadxn2vgLl/WXdJ4DJVs=' 
WHERE 
  key_id = '2903d7e9942a0c6b3866867afebd35ab90b9212dccb8bf28979dffe1defde2f7' 
  AND (
    token = '0kUC0QKpXw1LeojdNgDqjo3qadxn2vgLl/WXdJ4DJVs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032