UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'u7rD8nSeuHk5iNj8RfyZWCzRaCt4MtuqozQMJ2D3vwY=' 
WHERE 
  key_id = '42124418ed4358c2356d1d353e7597aaad562d3cae7e3d5236d95ab9974accb8' 
  AND (
    token = 'u7rD8nSeuHk5iNj8RfyZWCzRaCt4MtuqozQMJ2D3vwY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048