UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'evkEWoxcpz7rRIJzS55j08Nvyis/U+qrm1g5pi9+tRw=' 
WHERE 
  key_id = 'fa4d2064cfea04833564be43cba4adf15ef81ddead0b0b1b49dea8e4609ff759' 
  AND (
    token = 'evkEWoxcpz7rRIJzS55j08Nvyis/U+qrm1g5pi9+tRw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031